@Service
	public class PageFieldServiceImpl implements PageFieldService
	{
		@Resource
		private  PageFieldMapper  pageFieldMapper;
		@Override
		public int insertPageField(PageFieldParam param){
			PageField pageField = new PageField();
			if(param.getPageOperateId() != 0){
				pageField.setPageOperateId(param.getPageOperateId());
			}
			if(param.getPageFieldCode() != null){
				pageField.setPageFieldCode(param.getPageFieldCode());
			}
			if(param.getPageFieldName() != null){
				pageField.setPageFieldName(param.getPageFieldName());
			}
			if(param.getDescription() != null){
				pageField.setDescription(param.getDescription());
			}
			if(param.getCreateTime() != 0){
				pageField.setCreateTime(param.getCreateTime());
			}
			if(param.getUpdateTime() != 0){
				pageField.setUpdateTime(param.getUpdateTime());
			}
			 return pageFieldMapper.insertSelective(pageField);
		}
		@Override
		public int updatePageField(PageFieldEditParam param){
			PageField pageField = new PageField();
			if(param.getPageFieldId() != null){
				pageField = getPageField(Long.parseLong(param.getPageFieldId()));
			}
			if(pageField == null){
				return 0;
			}
			if(param.getPageOperateId() != 0){
				pageField.setPageOperateId(param.getPageOperateId());
			}
			if(param.getPageFieldCode() != null){
				pageField.setPageFieldCode(param.getPageFieldCode());
			}
			if(param.getPageFieldName() != null){
				pageField.setPageFieldName(param.getPageFieldName());
			}
			if(param.getDescription() != null){
				pageField.setDescription(param.getDescription());
			}
			if(param.getCreateTime() != 0){
				pageField.setCreateTime(param.getCreateTime());
			}
			if(param.getUpdateTime() != 0){
				pageField.setUpdateTime(param.getUpdateTime());
			}
			 return pageFieldMapper.updateByPrimaryKeySelective(pageField);
		}
		@Override
		public int deletePageField(long id){
			PageField pageField = getPageField(id);
			if(pageField == null){
				return 0;
			}
			return pageFieldMapper.deleteByPrimaryKey(id);
		}
		@Override
		public PageField getPageField(long id){
			 return pageFieldMapper.selectByPrimaryKey(id);
		}
		@Override
		public int deletePageFieldList(String ids){
			List<String> pageFieldList = Arrays.asList(ids.split(","));
			int count = 0;
			for (String id : pageFieldList) {
			count = count + deletePageField(Long.parseLong(id));
		}
			if( count == pageFieldList.size()){
			return 1;
			}else{
			return 0;
			}
	}
		@Override
		public List<PageField> selectPageField(PageFieldSelectParam param){
			PageFieldExample pageFieldExample = new PageFieldExample();
			pageFieldExample.setOrderByClause("create_time desc");
			PageFieldExample.Criteria criteria = pageFieldExample.createCriteria();
			if(param.getPageOperateId() != 0){
				criteria.andPageOperateIdEqualTo(param.getPageOperateId());
			}
			if(param.getPageFieldCode() != null){
				criteria.andPageFieldCodeEqualTo(param.getPageFieldCode());
			}
			if(param.getPageFieldName() != null){
				criteria.andPageFieldNameEqualTo(param.getPageFieldName());
			}
			if(param.getDescription() != null){
				criteria.andDescriptionEqualTo(param.getDescription());
			}
			if(param.getCreateTime() != 0){
				criteria.andCreateTimeEqualTo(param.getCreateTime());
			}
			if(param.getUpdateTime() != 0){
				criteria.andUpdateTimeEqualTo(param.getUpdateTime());
			}
			if (param.getOrder() != 0){
			}
			pageFieldExample.setLimitStart((param.getPageIndex() - 1) * param.getPageSize());
			pageFieldExample.setLimitEnd(param.getPageSize());
			List<PageField> pageFieldList = pageFieldMapper.selectByExample(pageFieldExample);
			return pageFieldList;
		}
		@Override
		public int countPageField(PageFieldSelectParam param){
			PageFieldExample pageFieldExample = new PageFieldExample();
			pageFieldExample.setOrderByClause("create_time desc");
			PageFieldExample.Criteria criteria = pageFieldExample.createCriteria();
			if(param.getPageOperateId() != 0){
				criteria.andPageOperateIdEqualTo(param.getPageOperateId());
			}
			if(param.getPageFieldCode() != null){
				criteria.andPageFieldCodeEqualTo(param.getPageFieldCode());
			}
			if(param.getPageFieldName() != null){
				criteria.andPageFieldNameEqualTo(param.getPageFieldName());
			}
			if(param.getDescription() != null){
				criteria.andDescriptionEqualTo(param.getDescription());
			}
			if(param.getCreateTime() != 0){
				criteria.andCreateTimeEqualTo(param.getCreateTime());
			}
			if(param.getUpdateTime() != 0){
				criteria.andUpdateTimeEqualTo(param.getUpdateTime());
			}
			if (param.getOrder() != 0){
			}
			pageFieldExample.setLimitStart((param.getPageIndex() - 1) * param.getPageSize());
			pageFieldExample.setLimitEnd(param.getPageSize());
			return pageFieldMapper.countByExample(pageFieldExample);
		}
}
